package com.hs.sfzy.controller;

import com.github.pagehelper.PageInfo;
import com.hs.sfzy.entity.SeleArt;
import com.hs.sfzy.service.SeleArtService;
import com.hs.sfzy.until.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName SeleArtController
 * @Description TODO
 * @Author liuzhuo
 * @Date 2025年08月13日 15:05
 * @Version 1.0
 */
@RestController
@RequestMapping("SeleArt")
public class SeleArtController {
    @Autowired
    private SeleArtService seleArtService;
    @GetMapping("page")
    public R selectAll(SeleArt seleArt,@RequestParam(required = false,defaultValue = "1") int pageNum,
                       @RequestParam(required = false,defaultValue = "3") int pageSize){
        PageInfo<SeleArt> seleArtPageInfo = seleArtService.selectAll(seleArt, pageNum, pageSize);
        return R.ok(seleArtPageInfo);
    }
    @GetMapping("{id}")
    public R selectById(@PathVariable("id") int id){
        SeleArt seleArt = seleArtService.selectById(id);
        return R.ok(seleArt);
    }

}
